﻿using AR.ViewModel.Candidat;
using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace AR.ViewModel.Commands.Candidat
{
    public class AddCandidat : ICommand
    {
        CreationCandidatViewModel _viewmodel;

        public AddCandidat(CreationCandidatViewModel viewModel)
        {
            this._viewmodel = viewModel;
        }
        public bool CanExecute(object parameter)
        {
            //return (_viewModel.SelectedCapture != null) ? true : false;
            return true;
        }

        public void Execute(object parameter)
        {
            _viewmodel.AddCandidat();
        }

        public event EventHandler CanExecuteChanged;

        protected virtual void OnCanExecuteChanged(EventArgs e)
        {
            var canExecuteChanged = CanExecuteChanged;

            if (canExecuteChanged != null)
                canExecuteChanged(this, e);
        }
    }
}
